package com.itgungnir.designpattern.state;

public class NoMoneyState implements State {
	private CandyMachine candyMachine;

	public NoMoneyState(CandyMachine candyMachine) {
		this.candyMachine = candyMachine;
	}

	@Override
	public void onMoneyInserted() {
		System.out.println("投币成功！");
		candyMachine.setState(candyMachine.getMoneyInsertedState());
	}

	@Override
	public void onMoneyReturned() {
		System.out.println("还没有投币！操作无效！");
	}

	@Override
	public void onCrankTurned() {
		System.out.println("还没有投币！操作无效！");
	}

	@Override
	public void onCandyPoped() {
		System.out.println("还没有投币！操作无效！");
	}
}